import { S } from '../../s';
import { IPSAppDEFLogic } from '../../app/dataentity/ipsapp-deflogic';
import { IPSAppDEField } from '../../app/dataentity/ipsapp-defield';
import { IPSDEFLogic } from './ipsdeflogic';
import { PSDELogicImpl } from './psdelogic-impl';

export class PSDEFLogicImpl
  extends PSDELogicImpl
  implements IPSDEFLogic, IPSAppDEFLogic
{
  get dEFLogicMode():
    | 'COMPUTE'
    | 'DEFAULT'
    | 'ONCHANGE'
    | 'CHECK'
    | 'USER'
    | 'USER2'
    | 'USER3'
    | 'USER4' {
    return this.M.dEFLogicMode;
  }

  protected psappdefield: IPSAppDEField;
  getPSAppDEField(): IPSAppDEField | null {
    return (
      this.psappdefield ||
      (this.psappdefield = this.fillObjectModel(
        S._1,
        this.M.getPSAppDEField,
        S._2e4,
      ) as IPSAppDEField)
    );
  }
  get cls(): string {
    return 'PSDEFLogicImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._201 || cls == S._202) return true;
    return super.instanceof(cls);
  }
}
